<!DOCTYPE html>
<html>
    <head>
        <?php echo $this->Html->charset(); ?>
        <title>
            <?php echo $title_for_layout; ?>
        </title>
        <link href="<?= SITE_URL ?>css/animate.css" rel="stylesheet">
        <link href="<?= SITE_URL ?>css/ui-lightness/jquery-ui-1.10.4.css" rel="stylesheet">
        <?php
            echo $this->Html->meta( 'icon' );

            echo $this->Html->css( 'bootstrap' );
            echo $this->Html->css( 'styles' );

            echo $this->fetch( 'meta' );
            echo $this->fetch( 'css' );
            echo $this->fetch( 'script' );
        ?>
        <script>SITE_URL = '<?=SITE_URL?>';</script>
    </head>
    <body>
        <div class="wrapper">
            <header id="header">
                <div class="container">
                    <strong class="logo"><?php echo $this->Html->link( 'Acathism', "/" ) ?></strong>
                    <h1>Acatism</h1>
                    <div class="menu">
                        <?php if( $logged_in ) : ?>
                            <!-- student/proffessor menu -->
                            <?php if( $user_role == "student" ) :
                                echo $this->element( "student_menu" );
                            else :
                                echo $this->element( "prof_menu" );
                            endif; ?>
                            <?php echo $this->Html->link( "<i class='fa fa-sign-out'></i> Logout", array(
                                "controller" => 'users',
                                "action"     => 'logout'
                            ), array( "escape" => false, "title" => "Logout" ) ) ?>
                        <?php else : ?>
                            <?php echo $this->Html->link( "<i class='fa fa-sign-in'></i> Login", array(
                                "controller" => 'users',
                                "action"     => 'login'
                            ), array( "escape" => false, "title" => "Login" ) ) ?> |
                            <?php echo $this->Html->link( "<i class='fa fa-key'></i> Register", array(
                                "controller" => "users",
                                "action"     => "register"
                            ), array( "escape" => false, "title" => "Register" ) ); ?>
                        <?php endif; ?>
                    </div>
                </div>
            </header>
            <div id="main">
                <div class="w2">
                    <div class="w3">
                        <div class="tabset-area container">
                            <div class="tabset-holder">
                                <?php echo $this->Session->flash(); ?>
                                <div class="tab-content">
                                    <div class="tab-pane active" id="tab1">
                                        <div class="clearfix holder">
                                            <?php echo $this->fetch( 'content' ); ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div><!-- / main -->
        </div><!-- / wrapper -->
        <script src="<?= SITE_URL ?>js/jquery-1.10.2.js" type="text/javascript"></script>
        <script src="<?= SITE_URL ?>js/jquery-ui-1.10.4.js" type="text/javascript"></script>
        <script src="<?= SITE_URL ?>js/jquery-ui-timepicker-addon.js" type="text/javascript"></script>
        <script src="<?= SITE_URL ?>js/dropzone.js" type="text/javascript"></script>
        <script src="<?= SITE_URL ?>js/script.js" type="text/javascript"></script>
    </body>
</html>